#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 0; i < n; i++) cin >> b[i];
    int t = -1;
    for(int i = 0; i < n; i++) {
        if(a[i] < b[i]) {
            if(t > -1) {
                cout << "NO\n";
                return;
            }
            t = b[i] - a[i];
        }
    }
    if(t == -1) cout << "YES\n";
    else{
        for(int i = 0; i < n; i++) {
            if(a[i] >= b[i] && a[i] - b[i] < t) {
                cout << "NO\n";
                return;
            }
        }
        cout << "YES\n";
    }
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}